﻿namespace SharpObjects.Configuration
{
    public interface IConfigurationProvider : IConfigurationReader
    {
        string Source { get; set; }
        bool Modified { get; }
        string ConfigurationVersion { get; set; }
        string ConfigurationSubVersion { get; set; }
        string SettingModification { get; set; }
        void SetValue<T>(string path, T value);
        void AddValue<T>(string parentPath, string name, T value, string encryptionKeyName = null, string id = null);
        void AddValues<T>(string parentPath, string name, T[] values, string encryptionKeyName = null, string[] ids = null);
        bool HasSetting(string path);

        void AddEncryptionKey(string encryptionKeyName, string encryptionKeyFileName);
        string CreateEncryptionKey(string encryptionKeyFileName, bool mapToAppData = false, bool overwrite = false); // returns actual path to the file
        void EncryptSetting(string path, string encryptionKeyName);
        void RemoveEncryption(string path);

        void Save();
    }
}
